# -*- coding: utf-8 -*-
import pygame
import random
pygame.init()
fpsClock = pygame.time.Clock()
screen = pygame.display.set_mode((800,600))
pygame.display.set_caption("Ex17.7")
background = pygame.Color( 0, 0, 0)
imgPaper = pygame.image.load("res/paper.png")
imgHammer = pygame.image.load("res/hammer.png")
imgScissors = pygame.image.load("res/scissors.png")
counter = 0
showStatus = False
random.seed( )
running = True
while running:
    fpsClock.tick(30)
    screen.fill(background)
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            pygame.quit()
            sys.exit()
        if event.type == pygame.KEYDOWN:
            if event.key == pygame.K_ESCAPE:
                running = False
    if showStatus == False:
        showStatus = True
        imgRandom = random.randint(1,3)
    if imgRandom == 1:
        screen.blit(imgPaper,(10,10))
    elif imgRandom == 2:
        screen.blit(imgHammer,(10,10))
    else:
        screen.blit(imgScissors,(10,10))
    counter = counter+1
    if counter == 60:
        counter = 0
        showStatus = False
    pygame.display.flip()
pygame.quit()